
        var ADF = {
            getElementsByADFTag : function(tag){
                return $.makeArray($(parentDom).find("[adftag~='" + tag + "']"));
            },
            getElementsByADFControlType : function(controlType){
                return $.makeArray($(parentDom).find("[ADF_Control_Type~='" + controlType + "']"));
            }
        };
        //如果一些方法或者变量希望继承者可以覆盖的话，就写到这个里面，继承者来覆盖这上面的属性
        var Override = {
            laydateChoose : function(dom, date){}
        }
        //anchor
        var anchors = ADF.getElementsByADFControlType("Anchor");
        for(var i=0;i<anchors.length;i++){
            anchors[i].style.height = 0;
        }
        //datetime
        var datetimes = ADF.getElementsByADFControlType("Datetime");
        for(var i=0;i<datetimes.length;i++){
            var format = datetimes[i].getAttribute("ADFFormat");
            (function(ele){
                laydate({elem:ele,format:format, choose : function(date){
                    Override.laydateChoose(ele, date);
                }});
            })(datetimes[i]);
        }
        //number
        var getNumberResult = function(event,obj,p){
            event = window.event||event;
            if(event.keyCode == 37 || event.keyCode == 39){
                    return;
            }
            obj.value = obj.value.replace(/[^\-\d.]/g,"");
            obj.value = obj.value.replace(/^\./g,"");
            obj.value = obj.value.replace(/\.{2,}/g,".");
            obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
            if(p<=0){
                obj.value = obj.value.replace(/[^\-\d]/g,"");
            }else {
                var re = eval('/([0-9]+\\.[0-9]{' + p + '})[0-9]*/');
                obj.value = obj.value.replace(re, "$1");
            }
        }

        var unConvertNumber = function(obj){
            var tempValue = obj.value;
            if(tempValue == ''){
                return tempValue;
            }else{
                var x = tempValue.split(',');
                var value = parseFloat(x.join(""));
                return value;
            }
        }

        var convertNumber = function(obj){
           var tempValue = obj.value;
           var p = obj.parentNode.getAttribute("ADFPrecision");
           if(tempValue == ""){
                return tempValue = "";
              }else{
                   var sPoint = tempValue.toString().split(".");
                   var sLength = sPoint.length;
                   if(sLength == 1){
                       if(p!=null){
                           var decimalPoint = '.';
                           for(var j=0;j<p;j++){
                                decimalPoint+='0';
                           }
                           tempValue = tempValue.toString()+decimalPoint;
                       }
                   }else if(sLength>1){
                            if(sPoint[1].length<p){
                            var dPoint = "";
                            var dLength = p-sPoint[1].length;
                            for(var k=0;k<dLength;k++){
                                dPoint+='0';
                            }
                       tempValue = tempValue.toString()+dPoint;
                   }
              }
              var q = obj.parentNode.hasAttribute("quartile");
              if(q){
                  var re = /\d{1,3}(?=(\d{3})+$)/g;
                  var value = tempValue.replace(/^(\d+)((\.\d+)?)$/,function(s,s1,s2){return s1.replace(re,"$&,")+s2;});
                  return value;
              }else{
                  return tempValue;
              }
           }
        }

        var numbers = ADF.getElementsByADFControlType("Number");
        for(var i=0;i<numbers.length;i++){
            var precision = numbers[i].getAttribute("ADFPrecision");
            var number = numbers[i].getElementsByTagName("input")[0];

            number.oncontextmenu = function(){
                return false;
            }
            number.onkeyup = function(){
               getNumberResult(event,this,precision);
            }
            number.onblur = function(){
               this.value = convertNumber(this);
            }
            number.onfocus = function(){
               this.value = unConvertNumber(this);
            }
        }